<template>
  <div>
    <el-col :span="24">

      <el-row>
        <div align="center"><h1>发送个人工作提醒</h1></div>
      </el-row>

      <el-row>
        <el-col :span="2"><div class="grid-content">&nbsp;</div></el-col>
        <el-col :span="4"><div class="grid-content">
          </div>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="2"><div class="grid-content">&nbsp;</div></el-col>
        <el-col :span="20"><div class="grid-content">
          </div>

         <h3>当前用户:</h3>
          <!-- <el-input v-model="whoareyou"  type="text"  rows="1"    readonly style="width:80%" /> -->
          <el-tag style="font-size: 20px"><b>{{ getuser }}</b></el-tag> 
          <br> <br> 



          <h3>1.填写发送的用户（中文名、域账号、手机号，逗号相隔）</h3>
          <!-- <h4>选择要发送的用户:</h4></div> -->
          <el-input v-model="user"  type="textarea"  rows="1" placeholder="例子：binbin.zhang,13372542902" style="width:80%" />


         <h3>2.填写发送的内容:</h3>
          <el-input v-model="val"  type="textarea"  rows="8" placeholder="# 温馨提醒：   
### 最近疫情起伏,建议大家：
### 1. 随身携带笔记本电脑
### 2. 收到系统密码到期提醒的请及时更改
**如有问题请及时联系IT服务中心.**
  ![alt 啊](https://img1.baidu.com/it/u=884550464,61617669&fm=253&fmt=auto&app=138&f=PNG?w=580&h=436)" style="width:80%" />



          <!-- <el-input  v-model="image" placeholder="请输入内容" /> -->
          <br><br><br><br>
          <el-button type="primary" style="width:20%" icon="el-icon-top" @click="sumbit">提交发送</el-button>

          <br><br>
          <div v-show="play" v-highlight>
            <pre><code class="javascript" v-html="message2" /></pre>
          </div>
          <br>
          <div  v-highlight >
            <pre><code class="markdown" v-html="message" /></pre>
          </div>



          <!-- <el-button type="primary" style="width:20%" icon="el-icon-top" @click="copyText" v-show="play">复制</el-button> -->
        </el-col>
      </el-row>



    </el-col>
  </div>

</template>

<script>
import { encryption, getuser } from '@/api/query'
//generatepassword
export default {
  data() {
    return {
         user:'',
         val:'',
         whoareyou : '',
      message2: '',
      play: false,
      message: 'markdown语法说明如下：\n\n# 一级标题\n## 二级标题\n### 三级标题\n#### 四级标题\n##### 五级标题\n###### 六级标题\n\n\n引用\n> A man who stands for nothing will fall for anything. \n\n文字加粗、斜体\n**bold**\n*italic* \n\n链接\n[this is a link](http://name.com) \n\n图片\n![](http://name.com/pic.jpg) \n\n无序列表\n- item1\n- item2 \n\n有序列表\n1. item1\n2. item2\n',
      getuser : 'admin',
      // msg:'加载中',
          }
  },
  created() {
        this.GetUser()
  },

  methods: {
    sumbit() {
      this.play = true
      encryption({ 'phones': this.user, 'val': this.val, 'whoareyou':this.whoareyou  }).then(response => {
        console.log(response.data)
        // console.log(response.data.length)
        // var val1 = '0'
        // var val1 = ''

        // for (var i = 0; i < response.data.length; i++) {
        //   console.log(response.data[i]) //取到加密前，加密后
        // }
        // console.log(response.value)
        this.message2 = response.data

        // this.value= response.data.podname
      })
    },
      GetUser(){
            console.log(this.$store.state.user.token)
            this.getuser =  this.$store.state.user.token
            this.whoareyou = this.getuser
        }

//
// copyText(){
//   var input = document.createElement("input");   // js创建一个input输入框
//   input.value = this.message2;  // 将需要复制的文本赋值到创建的input输入框中
//   document.body.appendChild(input);    // 将输入框暂时创建到实例里面
//   input.select();   // 选中输入框中的内容
//   document.execCommand("Copy");   // 执行复制操作
//   document.body.removeChild(input); // 最后删除实例中临时创建的input输入框，完成复制操作
//   this.$message({
//             message: '复制完成',
//             type: 'success',
//             offset: 80,
//           });
// },

  }
}
</script>

<style scoped>
.el-col {
  min-height: 1px
}
</style>
